home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _9C743A3F76664C4C961CC98F2A0A87CD < prev    next >
Text File  |  2005-07-29  |  657b  |  30 lines

  1. //extrudes object away from a light, fading out far edge
  2. //Luke Lenhart
  3. //(C)2004-2005 Digipen Institute of Technology
  4.  
  5. //texture sampler
  6. sampler2D sampTex;
  7.  
  8. //blend factor between 2 spots within texture
  9. float blend;
  10.  
  11. //shader input
  12. struct PS_INPUT
  13. {
  14.     float4 Color : COLOR;
  15.     float2 Tex0 : TEXCOORD0;
  16.     float4 Pos : TEXCOORD1;
  17. };
  18.  
  19. //shader code
  20. float4 PShader(PS_INPUT In) : COLOR
  21. {
  22.     //sample from here, and from 0.5 off
  23.     float4 clr0=tex2D(sampTex,In.Tex0);
  24.     float4 clr1=tex2D(sampTex,In.Tex0+float2(0.5f,0));
  25.     
  26.     //calc blend factor based on blendPos
  27.     //float ipol=sin(blendPos)
  28.     return lerp(clr0,clr1,blend)*In.Color;
  29. }
  30.